var id;

function pauseVideo() {
  chrome.tabs.sendRequest(id, {action: "pauseVideo"});
}

function onRequest(request, sender, sendResponse) {
  // Show the pause icon on this page because it contains videos
  chrome.pageAction.show(sender.tab.id);
  id = sender.tab.id;
  // Return nothing to let the connection be cleaned up.
  sendResponse({});
};

chrome.extension.onRequest.addListener(onRequest);
chrome.pageAction.onClicked.addListener(pauseVideo);

//$%@#$@#$@#$@#$@#$
//on currentfocus change, tab id changes?!
